﻿using Core.AutoFacService.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.AutoFacService.Attributes.InjectAttributes
{
	[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
	/// <summary>
	/// 实例注入特性
	/// </summary>
	public class ComponentAttribute:Attribute
    {
		public LifetimeEnum Lifetime { get; }
		public int Order { get;}
		/// <summary>
		/// 构造函数
		/// </summary>
		/// <param name="lifetime">生命周期</param>
		public ComponentAttribute(LifetimeEnum lifetime = LifetimeEnum.Scope,int order=0)
		{
			Lifetime = lifetime;
			Order= order;
		}
	}
}
